<?php
	autoLoader();
	
	$intPatientId = ( ( true == isset( $_GET['patient_id'] ) && true == valStr( $_GET['patient_id'] ) ) ? $_GET['patient_id'] : NULL );
	$objPatient = new Patients();
	$objPatient = $objPatient->fetchPatientsById( $intPatientId );
	
	if( true == valObj( $objPatient, 'BasePatients' ) ) {
		
		$objDoctor = new Doctors();
		$objDoctor = $objDoctor->fetchDoctorsById( $objPatient->getDoctorId() );
?>
<div id="patinet_info_details">
	<div style="float: left; width: 70%;">
		<table>
			<tr>
				<th style="width: 50%;">Full Name:</th>
				<td><?php echo $objPatient->getFirstName() . ( ( true == valStr( $objPatient->getMiddleName() ) ) ? ' ' . $objPatient->getMiddleName() : NULL ) . ' ' . $objPatient->getLastName(); ?></td>
			</tr>
			<tr>
				<th>Birth Date:</th>
				<td><?php echo ( ( true == valStr( $objPatient->getBirthDate() ) ) ? date( 'd-m-Y', strtotime( $objPatient->getBirthDate() ) ) : NULL ); ?></td>
			</tr>
			<tr>
				<th>Age:</th>
				<td><?php echo $objPatient->getAge(); ?></td>
			</tr>
			<tr>
				<th>Gender:</th>
				<td><?php echo PatientType::getGenderNameById( $objPatient->getGender() ); ?></td>
			</tr>
			<tr>
				<th>Patient Type:</th>
				<td><?php echo PatientType::getPatientTypeNameById( $objPatient->getPatientTypeId() ); ?></td>
			</tr>
			<tr>
				<th>Patient Area:</th>
				<td><?php echo PatientType::getPatientAreaNameById( $objPatient->getPatientAreaId() ); ?></td>
			</tr>
			<tr>
				<th>Doctor Name:</th>
				<td><?php echo ( true == valObj( $objDoctor, 'BaseDocotors' ) ) ? $objDoctor->getFirstName() . ' ' . $objDoctor->getLastName() : 'Somnath Test Doct'; ?></td>
			</tr>
		</table>
	</div>
	<div>
		<?php
			$strProfilePhotoPath = ( ( 2 == $objPatient->getGender() ) ? 'images/patient/default_profile_female.jpg' : 'images/patient/default_profile_male.jpg' );
			
			if( true == valStr( $objPatient->getPatientPhotoPath() ) && true == file_exists( $objPatient->getPatientPhotoPath() ) ) {
				$strProfilePhotoPath = $objPatient->getPatientPhotoPath();
			}
		?>
		<div><img src="<?php echo $strProfilePhotoPath; ?>" height="145" width="140" ></div>
	</div>
	<div style="clear: both;"></div>
</div>
<?php
	}
?>